﻿Imports System.IO

Public Class ctrSaoLuu

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        frmMain.TabControl1.TabPages.Remove(frmMain.TabControl1.SelectedTab)
    End Sub

    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim dlg As FolderBrowserDialog = New FolderBrowserDialog()
        If (dlg.ShowDialog() = DialogResult.OK) Then
            txtLink.Text = dlg.SelectedPath()
        End If
    End Sub

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        Dim f As FileInfo = New FileInfo(Application.StartupPath() + "\QLNH.mdb")
        f.CopyTo(txtLink.Text + "QLNH_" + Now.ToString("yyyyMMddhhmm") + ".mdb")
        MessageBox.Show("Sao lưu dữ liệu thành công!!!")
    End Sub
End Class
